#include <bits/stdc++.h>
#define endl '\n'
using namespace std;
long long n,m,k,u,v,x,cnt=0,a[100005],fa[100005],fa2[100005],dep[100005],u1[100005],v1[100005];
vector<pair<long long,long long> > edge;
vector<long long> edge2[100005];
pair<long long,long long> ans[100005];
bool bj[100005],vis[100005];
long long find(long long x)
{
	return fa[x]==x?fa[x]:fa[x]=find(fa[x]);
}
long long dfs(long long u,long long f)
{
	fa2[u]=f,dep[u]=dep[f]+1;
	long long t=(bj[u]?u:0);
	vis[u]=1;
	for(long long i=0;i<(long long)edge2[u].size();i++)
	{
		long long v=edge2[u][i];
		if(!vis[v])
		{
			long long t2=dfs(v,u);
			fa2[v]=u;
			dep[v]=dep[u]+1;
			if(t2)
			{
				if(t)
				{
					ans[++cnt]=make_pair(t,t2);
					t=0;
				}
				else
				{
					t=t2;
				}		
			}
		}
	}
	return t;
}
int main()
{
	freopen("travel.in","r",stdin);
	freopen("travel.out","w",stdout);
	ios::sync_with_stdio(0);
	cin.tie(0);
	cout.tie(0);
	cin>>n>>m>>k;
	while(m--)
	{
		cin>>u>>v;
		edge.push_back(make_pair(u,v));
	}
	for(long long i=1;i<=k;i++)
	{
		cin>>x;
		bj[x]=1;
	}
	for(long long i=1;i<=n;i++)
	{
		fa[i]=i;
	}
	for(long long i=0;i<(long long)edge.size();i++)
	{
		u=edge[i].first,v=edge[i].second;
		if(find(u)!=find(v))
		{
			fa[find(u)]=find(v);
			edge2[u].push_back(v);
			edge2[v].push_back(u);
		}
	}
	for(long long i=1;i<=n;i++)
	{
		if(fa[i]==i)
		{
			dfs(i,i);
		}
	}
	cout<<cnt<<endl;
	for(long long i=1;i<=cnt;i++)
	{
		long long s1=0,s2=0;
		u=ans[i].first,v=ans[i].second;
		if(dep[u]<dep[v])
		{
			swap(u,v);
		}
		while(dep[u]!=dep[v])
		{
			u1[++s1]=u;
			u=fa2[u];
		} 
		if(u!=v)
		{
			while(u!=v)
			{
				u1[++s1]=u;
				u=fa2[u];
				v1[++s2]=v;
				v=fa2[v];
			}
		}
		cout<<s1+s2+1<<" ";
		for(long long i=1;i<=s1;i++)
		{
			cout<<u1[i]<<" ";
		}
		cout<<v<<" ";
		for(long long i=s2;i>=1;i--)
		{
			cout<<v1[i]<<" ";
		}	
		cout<<endl;	
	}
	return 0;
}
